package scalaLearning.part2

class ConstructorDemo3 {
  //person1无法访问inage属性
  //person2可以读取inage属性
  //person3可以读，写inage属性
  private val person1 = new Person3(11)
  private val person2 = new Person4(11)
  private val person3 = new Person5(11)
}

class Person3(inage:Int){
  val age=inage
}


class Person4(val inage:Int){
  val age=inage
}

class Person5(var inage:Int){
  val age=inage
}